<template>
    <div class="one" style="width:1030px;margin:0 auto">
        <el-main id="main" style="text-align:left">
            <h2 style="text-align:center">非一套表单位法人主要经济指标</h2>
            <div style="text-align:right">
                <p>表号：711—1表</p>
                <p>制定机关：国家统计局国务院经济普查办公室</p>
                <p>文号：国统字（2018）号</p>
                <p>有效期至：2019年6月</p>
            </div>
            <div>
                <p>组织机构代码:&nbsp;{{organizationCode}}</p>
                <p>统一社会信用代码:&nbsp;{{socialCreditCode}}</p>
                <p>单位详细名称:&nbsp;{{unitDetailedName}}</p>
            </div>
            <el-form ref="form" :rules="rules" :model="form"   style="text-align:left" class="formOne"> 
                    <p style="text-align:center"><b>一、财务状况</b></p>
                    <table style="text-align:center;margin-top:5px;">
                        <thead>
                            <tr>
                                <th class="bian" style="width:400px;text-align:center">指标名称</th>
                                <th class="bian" style="width:200px;text-align:center" >计量单位</th>
                                <th class="bian" style="width:100px;text-align:center">代码</th>
                                <th  style="width:300px;text-align:center">本年</th>
                            </tr>
                        </thead>
                        <tbody >
                            <tr class="bian">
                                <td class="bian">甲</td>
                                <td class="bian">乙</td>
                                <td class="bian">丙</td>
                                <td>1</td>
                            </tr>
                            <tr> 
                               
                                <td class="bian">年初存货</td>
                                <td class="bian">千元</td>
                                <td class="bian">101</td>
                                <td>
                                    <el-form-item prop="beginInventory">
                                        <input type="text" name="" v-model="form.beginInventory"  @keyup="testMoney(form.beginInventory,'beginInventory')">
                                        <div class="red" v-show="saveData.beginInventory">请输入小数点后5位至小数点前20位之间的数字</div>.
                                    </el-form-item>    
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">期末存货</td>
                                <td class="bian">千元</td>
                                <td class="bian">205</td>
                                <td>
                                    <el-form-item prop="finalInventory">
                                        <input type="text" name="" v-model="form.finalInventory"  @keyup="testMoney(form.finalInventory,'finalInventory')">
                                        <div class="red" v-show="saveData.finalInventory">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>    
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">固定资产原价</td>
                                <td class="bian">千元</td>
                                <td class="bian">209</td>
                                <td>
                                    <el-form-item prop="fixedAssets">
                                        <input type="text" name="" v-model="form.fixedAssets"  @keyup="testMoney(form.fixedAssets,'fixedAssets')">
                                        <div class="red" v-show="saveData.fixedAssets">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">本年折旧</td>
                                <td class="bian">千元</td>
                                <td class="bian">211</td>
                                <td>
                                    <el-form-item prop="depreciation">
                                        <input type="text" name="" v-model="form.depreciation"  @keyup="testMoney(form.depreciation,'depreciation')">
                                        <div class="red" v-show="saveData.depreciation">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">在建工程</td>
                                <td class="bian">千元</td>
                                <td class="bian">212</td>
                                <td>
                                    <el-form-item prop="constructionProject">
                                        <input type="text" name="" v-model="form.constructionProject"  @keyup="testMoney(form.constructionProject,'constructionProject')">
                                        <div class="red" v-show="saveData.constructionProject">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">无形资产</td>
                                <td class="bian">千元</td>
                                <td  class="bian">246</td>
                                <td>
                                    <el-form-item prop="intangibleAssets">
                                        <input type="text" name="" v-model="form.intangibleAssets"  @keyup="testMoney(form.intangibleAssets,'intangibleAssets')">
                                        <div class="red" v-show="saveData.intangibleAssets">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">资产总计</td>
                                <td class="bian">千元</td>
                                <td class="bian">213</td>
                                <td>
                                    <el-form-item prop="totalAssets">
                                        <input type="text" name="" v-model="form.totalAssets"  @keyup="testMoney(form.totalAssets,'totalAssets')">
                                        <div class="red" v-show="saveData.totalAssets">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">负债合计</td>
                                <td class="bian">千元</td>
                                <td class="bian">217</td>
                                <td>
                                    <el-form-item prop="totalLiabilities">
                                        <input type="text" name="" v-model="form.totalLiabilities"  @keyup="testMoney(form.totalLiabilities,'totalLiabilities')">
                                        <div class="red" v-show="saveData.totalLiabilities">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">营业收入</td>
                                <td class="bian">千元</td>
                                <td class="bian">301</td>
                                <td>
                                    <el-form-item prop="businessIncome">
                                        <input type="text" name="" v-model="form.businessIncome"  @keyup="testMoney(form.businessIncome,'businessIncome')">
                                        <div class="red" v-show="saveData.businessIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">营业成本</td>
                                <td class="bian">千元</td>
                                <td class="bian">307</td>
                                <td>
                                    <el-form-item prop="operatingCost">
                                        <input type="text" name="" v-model="form.operatingCost"  @keyup="testMoney(form.operatingCost,'operatingCost')">
                                        <div class="red" v-show="saveData.operatingCost">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>

                            <tr> 
                                <td class="bian">税金及附加</td>
                                <td class="bian">千元</td>
                                <td class="bian">309</td>
                                <td>
                                    <el-form-item prop="taxAdditional">
                                        <input type="text" name="" v-model="form.taxAdditional"  @keyup="testMoney(form.taxAdditional,'taxAdditional')">
                                        <div class="red" v-show="saveData.taxAdditional">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">销售费用</td>
                                <td class="bian">千元</td>
                                <td class="bian">312</td>
                                <td>
                                    <el-form-item prop="sellingExpenses">
                                        <input type="text" name="" v-model="form.sellingExpenses"  @keyup="testMoney(form.sellingExpenses,'sellingExpenses')">
                                        <div class="red" v-show="saveData.sellingExpenses">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">管理费用</td>
                                <td class="bian">千元</td>
                                <td class="bian">313</td>
                                <td>
                                    <el-form-item prop="managementCost">
                                        <input type="text" name="" v-model="form.managementCost"  @keyup="testMoney(form.managementCost,'managementCost')">
                                        <div class="red" v-show="saveData.managementCost">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">财务费用</td>
                                <td class="bian">千元</td>
                                <td class="bian">317</td>
                                <td>
                                    <el-form-item prop="financialCost">
                                        <input type="text" name="" v-model="form.financialCost"  @keyup="testMoney(form.financialCost,'financialCost')">
                                        <div class="red" v-show="saveData.financialCost">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">投资收益</td>
                                <td class="bian">千元</td>
                                <td class="bian">322</td>
                                <td>
                                    <el-form-item prop="investmentIncome">
                                        <input type="text" name="" v-model="form.investmentIncome"  @keyup="testMoney(form.investmentIncome,'investmentIncome')">
                                        <div class="red" v-show="saveData.investmentIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td class="bian">营业利润</td>
                                <td class="bian">千元</td>
                                <td  class="bian">323</td>
                                <td>
                                    <el-form-item prop="operatingProfit">
                                        <input type="text" name="" v-model="form.operatingProfit"  @keyup="testMoney(form.operatingProfit,'operatingProfit')">
                                        <div class="red" v-show="saveData.operatingProfit">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td  class="bian">利润总额</td>
                                <td  class="bian">千元</td>
                                <td  class="bian">327</td>
                                <td>
                                    <el-form-item prop="totalProfit">
                                        <input type="text" name="" v-model="form.totalProfit"  @keyup="testMoney(form.totalProfit,'totalProfit')">
                                        <div class="red" v-show="saveData.totalProfit">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td  class="bian">职工薪酬总额</td>
                                <td  class="bian">千元</td>
                                <td  class="bian">401</td>
                                <td>
                                    <el-form-item prop="totalRemuneration">
                                        <input type="text" name="" v-model="form.totalRemuneration"  @keyup="testMoney(form.totalRemuneration,'totalRemuneration')">
                                        <div class="red" v-show="saveData.totalRemuneration">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr> 
                                <td  class="bian">增值税总额</td>
                                <td  class="bian">千元</td>
                                <td  class="bian">402</td>
                                <td>
                                    <el-form-item prop="totalTax">
                                        <input type="text" name="" v-model="form.totalTax"  @keyup="testMoney(form.totalTax,'totalTax')">
                                        <div class="red" v-show="saveData.totalTax">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <p style="text-align:center"><b>二、从业人员及工资总额</b></p>
                    <table style="text-align:center;margin-top:5px;">
                        <thead>
                            <tr>
                                <th  class="bian" style="width:400px;text-align:center">指标名称</th>
                                <th  class="bian" style="width:200px;text-align:center">计量单位</th>
                                <th  class="bian" style="width:100px;text-align:center">代码</th>
                                <th style="width:300px;text-align:center">本年</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td  class="bian">甲</td>
                                <td  class="bian">乙</td>
                                <td class="bian">丙</td>
                                <td>1</td>
                            </tr>
                            <tr>
                                <td class="bian">一、从业人员</td>
                                <td class="bian">-</td>
                                <td class="bian">-</td>
                                <td></td>
                            </tr>
                            <tr>
                                <td class="bian">&nbsp;&nbsp;从业人员期末人数</td>
                                <td class="bian">人</td>
                                <td class="bian">01</td>
                                <td>
                                    <el-form-item prop="finalEmployeesNumber">
                                        <input type="text" name="" v-model="form.finalEmployeesNumber"  @keyup="testPeople(form.finalEmployeesNumber,'finalEmployeesNumber')">
                                        <div class="red" v-show="saveData.finalEmployeesNumber">请输入正整数</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr>
                                <td class="bian">&nbsp;&nbsp;&nbsp;&nbsp;其中：女性</td>
                                <td class="bian">人</td>
                                <td class="bian">02</td>
                                <td>
                                    <el-form-item prop="femaleNumber">
                                        <input type="text" name="" v-model="form.femaleNumber"  @keyup="testPeople(form.femaleNumber,'femaleNumber')">
                                        <div class="red" v-show="saveData.femaleNumber">请输入正整数</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr>
                                <td class="bian">&nbsp;&nbsp;从业人员平均人数</td>
                                <td class="bian">人</td>
                                <td class="bian">03</td>
                                <td>
                                    <el-form-item prop="averageEmployeesNumber">
                                        <input type="text" name="" v-model="form.averageEmployeesNumber"  @keyup="testPeople(form.averageEmployeesNumber,'averageEmployeesNumber')">
                                        <div class="red" v-show="saveData.averageEmployeesNumber">请输入正整数</div>
                                    </el-form-item>
                                </td>
                            </tr>
                            <tr>
                                <td class="bian">二、工资总额</td>
                                <td class="bian">-</td>
                                <td class="bian">-</td>
                                <td></td>
                            </tr>
                            <tr>
                                <td class="bian">&nbsp;&nbsp;从业人员工资总额</td>
                                <td class="bian">千元</td>
                                <td class="bian">04</td>
                                <td>
                                    <el-form-item prop="totalWages">
                                        <input type="text" name="" v-model="form.totalWages"  @keyup="testMoney(form.totalWages,'totalWages')" @blur="testReason(form.totalWages)">
                                        <div class="red" v-show="saveData.totalWages">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                <div v-show="totalReason">
                <h4>补充资料：</h4>  
                 <el-form-item prop="reason">
                    <p>&nbsp;&nbsp;1.无法填报“从业人员工资总额”数据的原因：</p> 
                    <el-radio-group v-model="form.reason" @change="sourceFilter">
                        <el-radio :label="1" name="reason" style="margin-left:30px;">（1）本单位无生产经营活动。</el-radio><br>
                        <el-radio :label="2" name="reason" style="margin-left:30px;">（2）本单位不独立核算，工资有上级单位发放。</el-radio><br>
                        <el-radio :label="3" name="reason" style="margin-left:30px;">（3）本单位一套人马多块牌子，工资已在另一家单位统计。</el-radio><br>
                        <el-radio :label="4" name="reason" style="margin-left:30px;">（4）本单位属于单位内部性组织、互助性组织或非经营性组织，没有工资发放。</el-radio><br>
                        <el-radio :label="5" name="reason" style="margin-left:30px;">（5）本单位为没有雇员的家庭经营单位，没有工资发放。</el-radio><br>
                        <el-radio :label="6" name="reason" style="margin-left:30px;">（6）其他原因</el-radio>
                    </el-radio-group>
                    <div class="red" v-show="saveData.reason">请选择无法填报“从业人员工资总额”数据的原因</div>
                </el-form-item>
                <div  v-show="one">
                        <p>&nbsp;&nbsp;2.原因为(2)、(3)的单位填报</p>
                    <el-form-item prop="upOrganizationCode"> 
                        发放工资的法人单位：&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;组织机构代码：<el-input  class="width400" v-model="form.upOrganizationCode" @keyup.native="testEln(form.upOrganizationCode,'upOrganizationCode')"></el-input>
                    <div style="margin-left:270px;" class="red" v-show="saveData.upOrganizationCode">请输入数字或英文</div>
                    <div style="margin-left:270px;" class="red" v-show="showupSocialCreditCode">请输入统一社会信用代码或组织机构代码至少一项</div> 
                    </el-form-item> 
                    <el-form-item prop="upSocialCreditCode">
                        &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
                        统一社会信用代码： <el-input  class="width400" v-model="form.upSocialCreditCode"  @keyup.native="testEln(form.upSocialCreditCode,'upSocialCreditCode')"></el-input> 
                        <div style="margin-left:270px;" class="red" v-show="saveData.upSocialCreditCode">请输入数字或英文</div>
                        <div style="margin-left:270px;" class="red" v-show="showupSocialCreditCode">请输入统一社会信用代码或组织机构代码至少一项</div>   
                    </el-form-item>
                    <el-form-item prop="upUnitDetailedName">
                        &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
                        单位详细名称：<el-input class="width400" v-model="form.upUnitDetailedName"></el-input> 
                        <div style="margin-left:270px;" class="red" v-show="saveData.upUnitDetailedName">请输入汉字或英文</div>
                        <div style="margin-left:270px;" class="red" v-show="showupUnitDetailedName">请输入单位详细名称</div>   
                    </el-form-item>
                </div>
                </div>
                <el-form-item>
                    <p style="text-align:center"><b>三、批发业和零售也业经营情况</b></p>
                    <table style="text-align:center;margin-top:5px;">
                        <thead>
                            <tr>
                                <th class="bian" style="width:400px;text-align:center">指标名称</th>
                                <th class="bian" style="width:200px;text-align:center">计量单位</th>
                                <th class="bian" style="width:100px;text-align:center">代码</th>
                                <th style="width:300px;text-align:center">本年</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td class="bian">甲</td>
                                <td class="bian">乙</td>
                                <td class="bian">丙</td>
                                <td>1</td>
                            </tr>
                            <tr>
                                <td class="bian">商品购进额</td>
                                <td class="bian">千元</td>
                                <td class="bian">01</td>
                                <td>
                                    <el-form-item prop="commodityPurchase">
                                        <input type="text" name="" v-model="form.commodityPurchase"  @keyup="testMoney(form.commodityPurchase,'commodityPurchase')">
                                        <div class="red" v-show="saveData.commodityPurchase">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item> 
                                </td>
                            </tr>
                            <tr>
                                <td class="bian">商品销售额</td>
                                <td class="bian">千元</td>
                                <td class="bian">02</td>
                                <td>
                                    <el-form-item prop="commoditySales">
                                        <input type="text" name="" v-model="form.commoditySales"  @keyup="testMoney(form.commoditySales,'commoditySales')">
                                        <div class="red" v-show="saveData.commoditySales">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item> 
                                </td>
                            </tr>
                            <tr>
                                <td class="bian">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其中：零售额</td>
                                <td class="bian">千元</td>
                                <td class="bian">03</td>
                                <td>
                                    <el-form-item prop="retailSales">
                                        <input type="text" name="" v-model="form.retailSales"  @keyup="testMoney(form.retailSales,'retailSales')">
                                        <div class="red" v-show="saveData.retailSales">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item> 
                                </td>
                            </tr>
                            <tr>
                                <td class="bian">期末商品库存额</td>
                                <td class="bian">千元</td>
                                <td class="bian">04</td>
                                <td>
                                    <el-form-item prop="finalCommodityStock">
                                        <input type="text" name="" v-model="form.finalCommodityStock"  @keyup="testMoney(form.finalCommodityStock,'finalCommodityStock')">
                                        <div class="red" v-show="saveData.finalCommodityStock">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item> 
                                </td>
                            </tr>

                            <tr>
                                <td class="bian">服务营业额</td>
                                <td class="bian">千元</td>
                                <td class="bian">05</td>
                                <td>
                                    <el-form-item prop="serviceTurnover">
                                        <input type="text" name="" v-model="form.serviceTurnover"  @keyup="testMoney(form.serviceTurnover,'serviceTurnover')">
                                        <div class="red" v-show="saveData.serviceTurnover">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item> 
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <p style="text-align:center"><b>四、住宿业和餐饮业经营情况</b></p>
                    <table style="text-align:center;margin-top:5px;">
                        <thead>
                            <tr>
                                <th class="bian" style="width:400px;text-align:center">指标名称</th>
                                <th class="bian" style="width:200px;text-align:center">计量单位</th>
                                <th  class="bian" style="width:100px;text-align:center">代码</th>
                                <th  style="width:300px;text-align:center">本年</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td class="bian">甲</td>
                                <td class="bian">乙</td>
                                <td class="bian">丙</td>
                                <td >1</td>
                            </tr>
                            <tr>
                                <td class="bian">营业额</td>
                                <td class="bian">千元</td>
                                <td class="bian">06</td>
                                <td>
                                    <el-form-item prop="turnover">
                                        <input type="text" name="" v-model="form.turnover"  @keyup="testMoney(form.turnover,'turnover')">
                                        <div class="red" v-show="saveData.turnover">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item> 
                                </td>
                            </tr>
                            <tr>
                                <td class="bian">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其中：客房收入</td>
                                <td class="bian">千元</td>
                                <td class="bian">07</td>
                                <td>
                                    <el-form-item prop="roomIncome">
                                        <input type="text" name="" v-model="form.roomIncome"  @keyup="testMoney(form.roomIncome,'roomIncome')">
                                        <div class="red" v-show="saveData.roomIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item> 
                                </td>
                            </tr>
                            <tr>
                                <td class="bian">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;餐费收入</td>
                                <td class="bian">千元</td>
                                <td class="bian">08</td>
                                <td>
                                    <el-form-item prop="mealIncome">
                                        <input type="text" name="" v-model="form.mealIncome"  @keyup="testMoney(form.mealIncome,'mealIncome')">
                                        <div class="red" v-show="saveData.mealIncome">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item> 
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <p style="text-align:center"><b>五、电子商务交易情况</b></p>
                    <table style="text-align:center;margin-top:5px;">
                        <thead>
                            <tr>
                                <th class="bian" style="width:400px;text-align:center">指标名称</th>
                                <th class="bian" style="width:200px;text-align:center">计量单位</th>
                                <th class="bian" style="width:100px;text-align:center">代码</th>
                                <th style="width:300px;text-align:center">本年</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td class="bian">甲</td>
                                <td class="bian">乙</td>
                                <td class="bian">丙</td>
                                <td>1</td>
                            </tr>
                            <tr>
                                <td class="bian">电子商务采购额</td>
                                <td class="bian">千元</td>
                                <td class="bian">01</td>
                                <td>
                                    <el-form-item prop="eBusinessProcurement">
                                        <input type="text" name="" v-model="form.eBusinessProcurement"  @keyup="testMoney(form.eBusinessProcurement,'eBusinessProcurement')">
                                        <div class="red" v-show="saveData.eBusinessProcurement">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item> 
                                </td>
                            </tr>
                            <tr>
                                <td class="bian">电子商务销售额</td>
                                <td class="bian">千元</td>
                                <td class="bian">02</td>
                                <td>
                                    <el-form-item prop="eBusinessSales">
                                        <input type="text" name="" v-model="form.eBusinessSales"  @keyup="testMoney(form.eBusinessSales,'eBusinessSales')">
                                        <div class="red" v-show="saveData.eBusinessSales">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item> 
                                </td>
                            </tr>
                            <tr>
                                <td class="bian">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其中：通过非自营平台实现</td>
                                <td class="bian">千元</td>
                                <td class="bian">03</td>
                                <td>
                                    <el-form-item prop="nonSelfEmployedPlatform">
                                        <input type="text" name="" v-model="form.nonSelfEmployedPlatform"  @keyup="testMoney(form.nonSelfEmployedPlatform,'nonSelfEmployedPlatform')">
                                        <div class="red" v-show="saveData.nonSelfEmployedPlatform">请输入小数点后5位至小数点前20位之间的数字</div>
                                    </el-form-item> 
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </el-form-item>
                <el-form-item>
                    <span style="font-size:8px">单位负责人：</span>
                    <el-input style="width:100px" v-model="form.unitHead"></el-input>
                    <span style="font-size:8px">统计负责人：</span>
                    <el-input style="width:100px" v-model="form.statisticalControlOfficer"></el-input>
                    <span style="font-size:8px">填表人：</span>
                    <el-input style="width:100px" v-model="form.fillFormBy"></el-input>
                    <span style="font-size:8px">联系电话：</span>
                    <el-input style="width:120px" v-model="form.phone"></el-input>
                    <span style="font-size:8px">出报日期：</span>
                    <el-date-picker  v-model="form.createTime" class="width100 marginBottom"    type="date"  placeholder="选择日期"> </el-date-picker>
                </el-form-item>
                <el-form-item>
                    <div>
                        <p>说明：1.统计范围：辖区内除一套表调查单位、铁路和金融部门负责的单位以外的执行单位会计制度的法人单位。</p>
                        <p>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            2.报送日期及方式：2019年4月30日前通过非一套表单位采集处理软件或手持电子终端设备采集数据。
                        </p>
                        <p>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                           3.审核关系：
                        </p>
                        <p>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          财务状况：
                        </p>
                        <p>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            （1）流动资产合计≥ 其中：应收账款+其中：存货
                        </p>
                        <p>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            （2）累计折旧≥其中：本年折旧
                        </p>
                        <p>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            （3）资产总计≥流动资产合计
                        </p>
                        <p>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            （4）所有者权益合计=资产总计-负债合计
                        </p>
                        <p>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            （5）营业收入≥其中：主营业务收入
                        </p>
                        <p>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            （6）营业成本≥其中：主营业务成本
                        </p>
                        <p>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            （7）税金及附加≥ 其中：主营业务税金及附加
                        </p>
                        <p>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            （8）营业利润=营业收入-营业成本-税金及附加-销售费用-管理费用-财务费用+投资收益+公允价值变动收益-资产减值损失。
                        </p>
                        <p>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                           批发零售住宿餐饮经营情况：
                        </p> 
                        <p>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            (1)本表填报的数据必须大于或等于零   (2)02≥03  
                        </p>                 
                    </div>
                </el-form-item>            
            </el-form>
        </el-main>
         <div slot="footer" class="dialog-footer"> 
            <el-button type="primary" @click="submitFormone('form')">提交</el-button> 
            <el-button type="primary" @click="saveFormone">暂存</el-button>
            <el-button type="danger" @click="download">下载PDF表格</el-button>
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return{
            organizationCode:this.$store.get("organizationCode"),//组织机构代码
            socialCreditCode:this.$store.get("socialCreditCode"),//统一社会信用代码
            unitDetailedName:this.$store.get("unitDetailedName"),//单位详细名称
            id:null,
            one:false,
            totalReason:true,//不填写总额原因
            showupUnitDetailedName:false,
            showupSocialCreditCode:false,
            form:{
                beginInventory:'',//(101)年初库存量(千元,下面同理)                  
                finalInventory:'',//(205)期末库存量
                fixedAssets:'',//(209)固定资产原价
                depreciation:'',//(211)本年折旧
                constructionProject:'',//(212)在建工程
                intangibleAssets:'',//(246)无形资产
                totalAssets:'',//(213)资产总计
                totalLiabilities:'',//(217)负债合计
                businessIncome:'',//(301)营业收入
                operatingCost:'',//(307)营业成本
                taxAdditional:'',//(309)税金及附加
                sellingExpenses:'',//(312)销售费用
                managementCost:'',//(313)管理费用
                financialCost:'',//(317)财务费用
                investmentIncome:'',//(322)投资收益
                operatingProfit:'',//(323)营业利润
                totalProfit:'',//(327)利润总额
                totalRemuneration:'',//'(401)职工薪酬总额
                totalTax:'',//(402)增值税总额
                finalEmployeesNumber:'',//(01)从业人员期末人数
                femaleNumber:'',//(02)其中：女性人数
                averageEmployeesNumber:'',//(03)从业人员平均人数
                totalWages:'',//(04)从业人员工资总额 千元
                reason:'',//1.无法填报“从业人员工资总额”数据的原因
                upOrganizationCode:'',//组织机构代码  发放工资的法人单位
                upSocialCreditCode:'',//统一社会信用代码 发放工资的法人单位
                upUnitDetailedName:'',//单位详细名称 发放工资的法人单位
                commodityPurchase:'',//(01)商品购进额  千元
                commoditySales:'',//(02)商品销售额  千元
                retailSales:'',//(03)其中：零售额  千元
                finalCommodityStock:'',//(04)期末商品库存额 千元
                serviceTurnover:'',//(05)服务营业额  千元
                turnover:'',//(06)营业额  千元
                roomIncome:'',//(07)其中：客房收入  千元
                mealIncome:'',//(08)餐费收入  千元
                eBusinessProcurement:'',//(01)电子商务采购额  千元
                eBusinessSales:'',//(02)电子商务销售额  千元
                nonSelfEmployedPlatform:'',//(03)其中:通过非自营平台实现  千元
                unitHead:'',//单位负责人
                statisticalControlOfficer:'',//统计负责人
                fillFormBy:'',//填表人
                phone:'',//联系电话
                createTime:'',//填表时间
            },
            saveData:{
                beginInventory:false,//(101)年初库存量(千元,下面同理)                  
                finalInventory:false,//(205)期末库存量
                fixedAssets:false,//(209)固定资产原价
                depreciation:false,//(211)本年折旧
                constructionProject:false,//(212)在建工程
                intangibleAssets:false,//(246)无形资产
                totalAssets:false,//(213)资产总计
                totalLiabilities:false,//(217)负债合计
                businessIncome:false,//(301)营业收入
                operatingCost:false,//(307)营业成本
                taxAdditional:false,//(309)税金及附加
                sellingExpenses:false,//(312)销售费用
                managementCost:false,//(313)管理费用
                financialCost:false,//(317)财务费用
                investmentIncome:false,//(322)投资收益
                operatingProfit:false,//(323)营业利润
                totalProfit:false,//(327)利润总额
                totalRemuneration:false,//'(401)职工薪酬总额
                totalTax:false,//(402)增值税总额
                finalEmployeesNumber:false,//(01)从业人员期末人数
                femaleNumber:false,//(02)其中：女性人数
                averageEmployeesNumber:false,//(03)从业人员平均人数
                totalWages:false,//(04)从业人员工资总额 千元
                reason:false,//1.无法填报“从业人员工资总额”数据的原因
                upOrganizationCode:false,//组织机构代码  发放工资的法人单位
                upSocialCreditCode:false,//统一社会信用代码 发放工资的法人单位
                upUnitDetailedName:false,//单位详细名称 发放工资的法人单位
                commodityPurchase:false,//(01)商品购进额  千元
                commoditySales:false,//(02)商品销售额  千元
                retailSales:false,//(03)其中：零售额  千元
                finalCommodityStock:false,//(04)期末商品库存额 千元
                serviceTurnover:false,//(05)服务营业额  千元
                turnover:false,//(06)营业额  千元
                roomIncome:false,//(07)其中：客房收入  千元
                mealIncome:false,//(08)餐费收入  千元
                eBusinessProcurement:false,//(01)电子商务采购额  千元
                eBusinessSales:false,//(02)电子商务销售额  千元
                nonSelfEmployedPlatform:false,//(03)其中:通过非自营平台实现  千元
            },
            // rules: {
            //     // upOrganizationCode:[
            //     // { required: true, message: '请输入发放工资的法人单位组织机构代码', trigger: 'blur' },
            //     // { min: 9, max: 9, message: '长度为9个字符', trigger: 'blur' } 
            //     // ],
            //     //  upSocialCreditCode:[
            //     // { required: true, message: '请输入发放工资的法人单位社会信用代码', trigger: 'blur' },
            //     // { min: 18, max: 18, message: '长度为18个字符', trigger: 'blur' } 
            //     // ],
            //     // upUnitDetailedName: [
            //     // { required: true, message: '请输入发放工资的法人单位单位全称', trigger: 'blur' },
            //     // { min: 5, max: 30, message: '长度在 5 到 30 个字符', trigger: 'blur' }
            //     // ]
            // },
             rules: {
                beginInventory: [
                    { required: true, message: '请输入年初库存量', trigger: 'none' },
                ],
                finalInventory: [
                    { required: true, message: '请输入期末库存量', trigger: 'none' },
                ],
                fixedAssets: [
                    { required: true, message: '请输入固定资产原价', trigger: 'none' },
                ],
                depreciation: [
                    { required: true, message: '请输入本年折旧', trigger: 'none' },
                ],
                constructionProject: [
                    { required: true, message: '请输入在建工程', trigger: 'none' },
                ],
                intangibleAssets: [
                    { required: true, message: '请输入无形资产', trigger: 'none' },
                ],
                totalAssets: [
                    { required: true, message: '请输入资产总计', trigger: 'none' },
                ],
                totalLiabilities: [
                    { required: true, message: '请输入负债合计', trigger: 'none' },
                ],
                businessIncome: [
                    { required: true, message: '请输入营业收入', trigger: 'none' },
                ],
                operatingCost: [
                    { required: true, message: '请输入营业成本', trigger: 'none' },
                ],
                taxAdditional: [
                    { required: true, message: '请输入税金及附加', trigger: 'none' },
                ],
                sellingExpenses: [
                    { required: true, message: '请输入销售费用', trigger: 'none' },
                ],
                managementCost: [
                    { required: true, message: '请输入管理费用', trigger: 'none' },
                ],
                financialCost: [
                    { required: true, message: '请输入财务费用', trigger: 'none' },
                ],
                investmentIncome: [
                    { required: true, message: '请输入投资收益', trigger: 'none' },
                ],
                operatingProfit: [
                    { required: true, message: '请输入营业利润', trigger: 'none' },
                ],
                totalProfit: [
                    { required: true, message: '请输入利润总额', trigger: 'none' },
                ],
                totalRemuneration: [
                    { required: true, message: '请输入职工薪酬总额', trigger: 'none' },
                ],
                totalTax: [
                    { required: true, message: '请输入增值税总额', trigger: 'none' },
                ],
                finalEmployeesNumber: [
                    { required: true, message: '请输入从业人员期末人数', trigger: 'none' },
                ],
                averageEmployeesNumber: [
                    { required: true, message: '请输入从业人员平均人数', trigger: 'none' },
                ],
                femaleNumber: [
                    { required: true, message: '请输入女性人数', trigger: 'none' },
                ],
                // totalWages: [
                //     { required: true, message: '请输入从业人员工资总额', trigger: 'none' },
                // ],
                // reason: [
                //     { required: true, message: '请选择无法填报“从业人员工资总额”数据的原因', trigger: 'none' },
                // ],
                // upOrganizationCode: [
                //     { required: true, message: '请输入组织机构代码', trigger: 'none' },
                // ],
                // upSocialCreditCode: [
                //     { required: true, message: '请输入统一社会信用代码', trigger: 'none' },
                // ],
                // upUnitDetailedName: [
                //     { required: true, message: '请输入单位详细名称', trigger: 'none' },
                // ],
                commodityPurchase: [
                    { required: true, message: '请输入商品购进额', trigger: 'none' },
                ],
                commoditySales: [
                    { required: true, message: '请输入商品销售额', trigger: 'none' },
                ],
                retailSales: [
                    { required: true, message: '请输入零售额', trigger: 'none' },
                ],
                finalCommodityStock: [
                    { required: true, message: '请输入期末商品库存额', trigger: 'none' },
                ],
                serviceTurnover: [
                    { required: true, message: '请输入服务营业额', trigger: 'none' },
                ],
                turnover: [
                    { required: true, message: '请输入营业额', trigger: 'none' },
                ],
                roomIncome: [
                    { required: true, message: '请输入客房收入', trigger: 'none' },
                ],
                mealIncome: [
                    { required: true, message: '请输入餐费收入', trigger: 'none' },
                ],
                eBusinessProcurement: [
                    { required: true, message: '请输入电子商务采购额', trigger: 'none' },
                ],
                eBusinessSales: [
                    { required: true, message: '请输入电子商务销售额', trigger: 'none' },
                ],
                nonSelfEmployedPlatform: [
                    { required: true, message: '请输入通过非自营平台实现', trigger: 'none' },
                ],
             },
        }

    },
     mounted:function(){
        this.getDate();
    },
    methods:{
        getDate(){
            let self =this;
            let baseId=this.$store.get("companyId");
            console.log(baseId);
            this.$http({
                mothod:'get',
                url:'711One/get?baseId='+baseId,
            }).then(function(res){
                console.log(res);
                console.log(res.data.length);
                if(res.status===200){
                    if(res.data.status===401){
                        self.$message.error("请先登录！");
                        self.$router.push({ path: '/' });
                        return;
                    }
                    if(res.data.length===0){
                        self.id =null;
                    }else{
                         if(res.data[0].totalWages || res.data[0].totalWages === 0){
                            self.totalReason = false;
                        }else{
                            self.totalReason = true;
                        }
                        self.form = res.data[0];
                        console.log(self.form);
                        console.log(res.data[0]);
                        self.id = res.data[0].id;
                        self.form.updateTime = res.data[0].newupdateTime;
                    }
                }else{
                    self.$message.error(res.message);
                }
            }).catch(function(err){
                console.log(err)
            })
        },
        submitFormone(formName){
            console.log(this.form.totalWages!=0);
            console.log(!this.form.totalWages);
            //判断合法输入
            if(this.form.totalWages || this.form.totalWages==='0'){
                this.saveData.reason = false;
                this.form.reason = null;
            }
             if(this.form.reason){
                this.saveData.reason = false;
            }
            if(this.form.reason!=2 && this.form.reason!=3){
                this.saveData.upOrganizationCode = false;
                this.saveData.upSocialCreditCode = false;
                this.saveData.upUnitDetailedName = false;
                this.form.upOrganizationCode = null;
                this.form.upSocialCreditCode = null;
                this.form.upUnitDetailedName = null;
            }
            for(var k in this.saveData){
                if(this.saveData[k] === true){
                    return;
                }
            }
            //判断必填
            if(!this.form.totalWages && this.form.totalWages!='0'){
                console.log(0);
                if(!this.form.reason){
                    this.saveData.reason = true;
                    return;
                }
            }
            if(this.form.reason===2 || this.form.reason===3){
                console.log(1);
                if(!this.form.upUnitDetailedName && this.form.upUnitDetailedName!='0'){
                    this.showupUnitDetailedName = true;
                    console.log(12);
                    return;
                }else if(!this.form.upSocialCreditCode && this.form.upSocialCreditCode!='0'){
                    if(!this.form.upOrganizationCode && this.form.upOrganizationCode!='0'){
                        this.showupSocialCreditCode = true;
                        console.log(1222);
                        return;
                    }
                }
            }
            this.$refs[formName].validate((valid) => {
            if (valid) {
                let self = this;
                let data = this.form;
                data.baseId= this.$store.get("companyId");
                data.id=this.id;
                data.state = 1;
                console.log(data);
                this.$http({
                    method:'post',
                    url:'711One/insertOrUpdate',
                    data:data,
                }).then(function(res){
                    console.log(res);
                    if(res.status === 200){
                        self.$message.success(res.data.message);
                        self.form = res.data.data;
                        self.form.updateTime = res.data.data.newupdateTime;
                        self.$router.push({ path: '/home' });
                    }else{
                        self.$message.error(res.data.message);
                    }
                }).catch(function(err){
                    console.log(err);
                    
                })
            } else {
                return false;
            }
            });
           
        },
        //暂存
        saveFormone(){
             //判断合法输入
            if(this.form.totalWages || this.form.totalWages=== 0){
                this.saveData.reason = false;
                this.form.reason = null;

            }
            if(this.form.reason!=2 && this.form.reason!=3){
                this.saveData.upOrganizationCode = false;
                this.saveData.upSocialCreditCode = false;
                this.saveData.upUnitDetailedName = false;
                this.form.upOrganizationCode = null;
                this.form.upSocialCreditCode = null;
                this.form.upUnitDetailedName = null;
            }
            for(var k in this.saveData){
            if(this.saveData[k] === true){
                return;
            }
            }
            let self = this;
                let data = this.form;
                data.baseId= this.$store.get("companyId");
                data.id=this.id;
                data.state = 0;
                console.log(data);
                this.$http({
                    method:'post',
                    url:'711One/insertOrUpdate',
                    data:data,
                }).then(function(res){
                    console.log(res);
                    if(res.status === 200){
                        self.$message.success(res.data.message);
                        self.form = res.data.data;
                        self.form.updateTime = res.data.data.newupdateTime;
                        self.$router.push({ path: '/home' })
                    }else{
                        self.$message.error(res.data.message);
                    }
                }).catch(function(err){
                    console.log(err);
                    
                })
            },
        sourceFilter(label){
            console.log(label);
            if(label ===2 || label===3){
                this.one = true;
            }else{
                this.one = false;
            }
        },
        //检验输入金额
        testMoney(value,data){
            let reg =  /^(\-|\+?)\d{1,15}(\.\d{1,5})?$/;
            if(!reg.test(value) && value){
                for(var r in this.saveData){
                if(r === data){
                    this.saveData[r] = true;
                }
                }
            }else if(reg.test(value) || !value){
                for(var rs in this.saveData){
                if(rs === data){
                    this.saveData[rs] = false;
                }
                }
            }
        },
        //检验输入人数`
        testPeople(value,data){
            let reg = /^(\d{1,11})$/;
            if(!reg.test(value) && value){
                for(var r in this.saveData){
                if(r === data){
                    this.saveData[r] = true;
                }
                }
            }else if(reg.test(value) || !value){
                for(var rs in this.saveData){
                if(rs === data){
                    this.saveData[rs] = false;
                }
                }
            }
        },
         //下载pdf
        download(){
            let self = this;
            let data = this.formData;
            console.log(data.state);
            if(data.state === 2){
                console.log(555555555555555555);
                //  let url = 'http://192.168.0.131:8001/register/711Base/downLoad?baseId='+this.$store.get("companyId");
            let url = this.$downloadUrl+'/711One/downLoad?baseId='+this.$store.get("companyId");
            window.location.href=url;
            }else{
                this.$message.error('有未提交表不能下载');
            }
        },
         //检验组织机构代码，社会信用代码
        testEln(value,data){
            console.log("1111");
            let reg = /^[a-zA-Z0-9]*$/;
            if(!reg.test(value) && value){
                    this.saveData[data] = true;
            }else if(reg.test(value) || !value){
                    this.saveData[data] = false;
            }
        },
        // 检验是否填总额原因
        testReason(value){
            console.log(value);
            if(value || value === 0){
                this.totalReason = false;
            }else{
                this.totalReason = true;
            }
        },
    }          
}
</script>
<style scoped>
    #main input{
        border:0px solid #dcdfe6;
        border-bottom: 1px solid #1d1e20;
        border-radius: 0;
    }
    .width400{
        width: 400px;
    }
     #main table tr,#main table td,#main table th{
        /* border-right: 1px solid #ddd; */
        /* border-left: 1px solid #ddd; */
        border-bottom: 1px solid #DDD;
        border-top: 1px solid #DDD;
    }
    .bian{
        border-right: 1px solid #ddd;
    }
</style>

